#ifndef HPLCSPARKLINKCOMMONPROTOCOLDATA_H
#define HPLCSPARKLINKCOMMONPROTOCOLDATA_H

#include <QList>
#include <QByteArray>
#include "baseprotocoldata.h"
#include "hplcsparklinkautosamplerpfcid.h"

//class BaseProtocolData;

namespace hplc
{
namespace sparklink
{

typedef enum
{
    Reply_waiting = 0,
    Reply_ok,
    Reply_ack,
    Reply_nack,
    Reply_nack0,
    Reply_none,
}Reply;

class HplcSparkLinkMakePacket;
class HplcSparkLinkCheckPacket;
class HplcSparkLinkProtocolCommonData : public BaseProtocolData
{
public:
    quint8              			 m_id;

    HplcSparkLinkMakePacket          *m_maker = nullptr;

    // checker专用
    HplcSparkLinkCheckPacket         *m_checker = nullptr;
    bool							 m_waitReplyTimerStart = false;
    quint32							 m_waitReplyTimerCount = 0;
    quint32							 m_waitReplyTimerNumber = 1000;
    bool							 m_isWaitReply = false;
    HplcSparkLinkAutoSamplerPfcId 	 m_waitPfc = HplcSparkLinkAutoSamplerPfcId_None;
    Reply							 m_reply = Reply_none;

//    // finder专用
//    quint32             m_framePos = 0;
//    QByteArray          m_rxBufferAscii; // 这个缓冲区主要用于Ascii转Hex

//    QByteArray          m_rxBufferHex;

    QList<QByteArray>   m_txBufferAsciiList;
};

} // sparklink
} // hplc

#endif // HPLCSPARKLINKCOMMONPROTOCOLDATA_H
